#pragma once

// Dependencies
namespace Core {
	template<class T> class Vector2_t;
}

namespace Core {
	// Point2
	// Represents a point in 2-dimensional space
	template<class T>
	class Point2_t {
	public: // Typedefs
		typedef T value_type;
		typedef Point2_t<T> this_type;

	public: // Constructors
		Point2_t();
		Point2_t( T x, T y );

	public: // Operators
		const Vector2_t<T> operator - ( const Point2_t<T>& pt ) const;

		const Point2_t<T> operator + ( const Vector2_t<T>& vec ) const;
		Point2_t<T>& operator += ( const Vector2_t<T>& vec );
	
	public: // Comparison operators
		bool operator == ( const Point2_t<T>& pt ) const;
		bool operator != ( const Point2_t<T>& pt ) const;
		bool operator < ( const Point2_t<T>& pt ) const;

	public: // Methods
		Vector2_t<T> fromOrigin() const;

	public: // Accessors
		T& operator[] ( int idx );
		const T& operator[] ( int idx ) const;
		
	public: // Static members
		static const Point2_t<T> origin;

	private: // Helper members
		static T Point2_t::* const (map[2]);

	public: // Members
		T x, y;
	};

	// Typedefs available to the Core namespace
	typedef Point2_t<int> Point2i;
	typedef Point2_t<double> Point2;
	typedef Point2_t<float> Point2f;
}